<template>
  <div>
    {{ num }}
    <button @click="addNum(10)">+</button>
    <button @click="addNumAsync(30)">异步+</button>
  </div>
</template>

<script>
import { mapState, mapGetters, mapMutations, mapActions } from 'vuex'
export default {
  methods: {
    ...mapMutations(['addNum', 'reduceNum']),
    ...mapActions(['addNumAsync'])
  },
  computed: {
    ...mapState(['num']),
    ...mapGetters('doubleNum'),
    num () {
      return this.$store.state.num
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
